/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.util;

/**
 * 型材库 所有计算方法
 *
 * @author hxloongs
 * @date 2024-7-31
 */
public class SectionCalculateUtils {
    /**
     * 计算帽型长桁属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateCapProfile(double[] layerParameters,
                                           double[] shapeParameters,
                                           double[] sectionProperties) {
        double T = layerParameters[0];
        double E = layerParameters[1];
        double G = layerParameters[2];

        double ALPHA = shapeParameters[0];
        double D = shapeParameters[1];
        double H = shapeParameters[2];
        double L = shapeParameters[3];
        double R1 = shapeParameters[4];
        double R2 = shapeParameters[5];

        double PII = Math.PI;
        double RA = ALPHA * PII / 180;

        // R1处扇形面积
        double sr11 = PII * Math.pow(R1 + T, 2) * (90 - ALPHA) / 360;
        double sr12 = PII * Math.pow(R1, 2) * (90 - ALPHA) / 360;
        double SR1 = sr11 - sr12;

        // R2处扇形面积
        double sr21 = PII * Math.pow(R2 - T, 2) * (90 - ALPHA) / 360;
        double sr22 = PII * Math.pow(R2, 2) * (90 - ALPHA) / 360;
        double sR2 = sr22 - sr21;

        // 底边面积
        double L_bottom = L - (R2 - T) * Math.cos(RA);
        double ST2 = 2 * T * L_bottom;

        // 顶边面积
        double s2 = T * (D - 2 * R1 * Math.sin(0.5 * (PII / 2 - RA)));

        // 斜边高度
        double Hx = (H - (R1 + R2) * (1 - Math.cos(PII / 2 - RA)));

        // 斜直段面积
        double Sx = T * Hx / Math.cos(RA);

        // 总面积
        double A_ALL = 2 * (Sx + sR2 + SR1) + s2 + ST2;

        // 截面等效模量
        double E_E = E;
        double E_G = G;

        // 计算静矩
        double XC = (ST2 + 2 * sR2) * T / 2 + (s2 + 2 * SR1) * (H + T / 2);
        XC += 2 * Sx * (H + (-R1 + R2) * (1 - Math.cos(PII / 2 - RA)) + T * Math.sin(RA)) / 2;

        // 计算型心
        XC /= A_ALL;

        // 计算主惯性矩
        double I_ALL = s2 * Math.pow(H + T / 2 - XC, 2) + 2 * SR1 * Math.pow(H - XC, 2);
        I_ALL += ST2 * Math.pow(XC - T / 2, 2) + 2 * sR2 * Math.pow(XC - T, 2);
        I_ALL += 2 * Sx * Math.pow((H + (-R1 + R2) * (1 - Math.cos(PII / 2 - RA)) + T * Math.sin(RA)) / 2 - XC, 2);
        I_ALL += 2 * T * Math.pow(Hx, 3) / Math.cos(RA) / 12;

        // 计算惯性矩_纵轴
        double I_ADD = T * Math.pow(D - 2 * R1 * Math.sin(0.5 * (PII / 2 - RA)), 3) / 12;
        I_ADD += 2 * T * Math.pow(L_bottom, 3) / 12 + ST2 * Math.pow(D / 2 + Hx * Math.sin(RA) + L - L_bottom, 2);
        I_ADD += 2 * T * Math.pow(Hx, 3) / Math.sin(RA) / 12 + 2 * Sx * Math.pow(D / 2 + Hx / 2, 2);

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
    }

    /**
     * 计算T型长桁属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateTProfile(double[][] layerParameters, double[] shapeParameters, double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double rho1 = layerParameters[0][3];
        double THM1 = layerParameters[0][4];
        double T2 = layerParameters[1][0];
        double E2 = layerParameters[1][1];
        double G2 = layerParameters[1][2];
        double RHO2 = layerParameters[1][3];
        double THM2 = layerParameters[1][4];
        double W = shapeParameters[0];
        double H = shapeParameters[1];

        // 竖边面积
        double ST1 = T1 * (H - T2);
        // 横边面积
        double ST2 = T2 * W;
        // 总面积
        double A_ALL = ST1 + ST2;
        // 等效模量
        double E_E = (E1 * ST1 + E2 * ST2) / A_ALL;
        double E_G = (G1 * ST1 + G2 * ST2) / A_ALL;
        // 等效密度
        double E_RHO = (rho1 * ST1 + RHO2 * ST2) / A_ALL;
        // 等效热膨胀系数
        double E_THM = (E1 * ST1 * THM1 + E2 * ST2 * THM2) / (E_E * A_ALL);
        // 型心
        double XC = (E1 * ST1 * (H + T2) / 2 + E2 * ST2 * (T2) / 2) / A_ALL / E_E;
        // 主惯性矩（型心水平轴）
        double I_ALL = (ST2 * Math.pow(XC - T2 / 2, 2)) * E2 / E_E;
        I_ALL += (ST1 * Math.pow(H / 2 + T2 / 2 - XC, 2)) * E1 / E_E;
        I_ALL += (T1 * Math.pow(H - T2, 3) / 12) * E1 / E_E;
        // 惯性矩（型心垂直轴）
        double I_ADD = T2 * Math.pow(W, 3) / 12 * E2 / E_E + (H - T2) * Math.pow(T1, 3) / 12 * E1 / E_E;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
        sectionProperties[6] = E_RHO;
        sectionProperties[7] = E_THM;
    }

    /**
     * 计算I型型材属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateIProfile(double[][] layerParameters,
                                         double[] shapeParameters,
                                         double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double rho1 = layerParameters[0][3];
        double THM1 = layerParameters[0][4];
        double T2 = layerParameters[1][0];
        double E2 = layerParameters[1][1];
        double G2 = layerParameters[1][2];
        double RHO2 = layerParameters[1][3];
        double THM2 = layerParameters[1][4];
        double T3 = layerParameters[2][0];
        double E3 = layerParameters[2][1];
        double G3 = layerParameters[2][2];
        double RHO3 = layerParameters[2][3];
        double THM3 = layerParameters[2][4];
        double W1 = shapeParameters[0];
        double H = shapeParameters[1];
        double W2 = shapeParameters[2];

        // 竖边面积
        double ST2 = T2 * (H - T1 - T3);
        // 底边面积
        double ST1 = T1 * W1;
        // 顶边面积
        double ST3 = T3 * W2;
        // 总面积
        double A_ALL = ST1 + ST2 + ST3;
        // 等效模量
        double E_E = (E1 * ST1 + E2 * ST2 + E3 * ST3) / A_ALL;
        double E_G = (G1 * ST1 + G2 * ST2 + G3 * ST3) / A_ALL;
        // 等效密度
        double E_RHO = (rho1 * ST1 + RHO2 * ST2 + RHO3 * ST3) / A_ALL;
        // 等效热膨胀系数
        double E_THM = (E1 * ST1 * THM1 + E2 * ST2 * THM2 + E3 * ST3 * THM3) / (E_E * A_ALL);
        // 型心
        double XC = (E2 * ST2 * (H - T3 + T1) / 2 + E1 * ST1 * (T1) / 2 + E3 * ST3 * (H - T3 / 2)) / A_ALL / E_E;
        // 惯性矩（型心水平轴）
        double I_ALL = (ST1 * Math.pow(XC - T1 / 2, 2)) * E1 / E_E; // 底边惯性矩
        I_ALL += (ST2 * Math.pow(H / 2 + T1 / 2 - T3 / 2 - XC, 2)) * E2 / E_E; // +竖边惯性矩平行轴移动
        I_ALL += (T2 * Math.pow(H - T1 - T3, 3) / 12) * E2 / E_E; // +竖边惯性矩
        I_ALL += (ST3 * Math.pow(H - XC - T3 / 2, 2)) * E3 / E_E; // +顶边惯性矩
        // 惯性矩（型心垂直轴）
        double I_ADD = T1 * Math.pow(W1, 3) / 12 * E1 / E_E + T3 * Math.pow(W2, 3) / 12 * E3 / E_E;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
        sectionProperties[6] = E_RHO;
        sectionProperties[7] = E_THM;
    }


    /**
     * 计算C型金属框属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateFcProfile(double[][] layerParameters,
                                          double[] shapeParameters,
                                          double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double rho1 = layerParameters[0][3];
        double THM1 = layerParameters[0][4];
        double T2 = layerParameters[1][0];
        double E2 = layerParameters[1][1];
        double G2 = layerParameters[1][2];
        double RHO2 = layerParameters[1][3];
        double THM2 = layerParameters[1][4];
        double T3 = layerParameters[2][0];
        double E3 = layerParameters[2][1];
        double G3 = layerParameters[2][2];
        double RHO3 = layerParameters[2][3];
        double THM3 = layerParameters[2][4];
        double W1 = shapeParameters[0];
        double H = shapeParameters[1];
        double W2 = shapeParameters[2];
        double SD = shapeParameters[3];

        // 竖边面积
        double ST2 = T2 * (H - T1 - T3);
        // 底边面积
        double ST1 = T1 * W1;
        // 顶边面积
        double ST3 = T3 * W2;
        // 总面积
        double A_ALL = ST1 + ST2 + ST3;
        // 等效模量
        double E_E = (E1 * ST1 + E2 * ST2 + E3 * ST3) / A_ALL;
        double E_G = (G1 * ST1 + G2 * ST2 + G3 * ST3) / A_ALL;
        // 等效密度
        double E_RHO = (rho1 * ST1 + RHO2 * ST2 + RHO3 * ST3) / A_ALL;
        // 等效热膨胀系数
        double E_THM = (E1 * ST1 * THM1 + E2 * ST2 * THM2 + E3 * ST3 * THM3) / (E_E * A_ALL);
        // 型心
        double XC = (E1 * ST1 * (T1) / 2 + E2 * ST2 * (H - T3 + T1) / 2 + E3 * ST3 * (H - T3 / 2)) / A_ALL / E_E;
        double YC = (E1 * ST1 * W1 / 2 + E2 * ST2 * T2 / 2 + E3 * ST3 * W2 / 2) / A_ALL / E_E;
        // 主惯性矩（型心水平轴）
        double I_ALL = (ST1 * Math.pow(XC - T1 / 2, 2)) * E1 / E_E;
        I_ALL += (ST2 * Math.pow(H / 2 + T1 / 2 - T3 / 2 - XC, 2)) * E2 / E_E;
        I_ALL += (T2 * Math.pow(H - T1 - T3, 3) / 12) * E2 / E_E;
        I_ALL += (ST3 * Math.pow(H - XC - T3 / 2, 2)) * E3 / E_E;
        // 惯性矩（型心垂直轴）
        double I_ADD = (T1 * Math.pow(W1, 3) / 12 + ST1 * Math.pow(W1 - YC, 2)) * E1 / E_E;
        I_ADD += ST2 * Math.pow(YC - T2 / 2, 2) * E2 / E_E;
        I_ADD += (T3 * Math.pow(W2, 3) / 12 + ST3 * Math.pow(W2 - YC, 2)) * E3 / E_E;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
        sectionProperties[6] = E_RHO;
        sectionProperties[7] = E_THM;
    }

    /**
     * 计算Z型框属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateFzProfile(double[][] layerParameters,
                                          double[] shapeParameters,
                                          double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double W1 = shapeParameters[0];
        double H = shapeParameters[1];
        double W2 = shapeParameters[2];
        double R = shapeParameters[3];

        // 圆角面积
        double SR1 = Math.PI * (-Math.pow(R, 2) + Math.pow(R + T1, 2)) / 4;
        // 竖边面积
        double ST2 = T1 * (H - 2 * (R + T1));
        // 底边面积
        double ST1 = T1 * (W1 - (R + T1));
        // 顶边面积
        double ST3 = T1 * (W2 - (T1 + R));
        // 总面积
        double A_ALL = ST1 + ST2 + ST3 + 2 * SR1;
        // 等效模量
        double E_E = E1;
        double E_G = G1;
        // 圆环形心位置
        double XRC = 4 * (-Math.pow(R, 3) + Math.pow(R + T1, 3)) / 3 / Math.PI / (-Math.pow(R, 2) + Math.pow(R + T1, 2));
        // 型心
        double XC = (ST1 * T1 / 2 + ST3 * (H - T1 / 2) + ST2 * H / 2 + SR1 * H) / A_ALL;
        double YC = (ST1 * (W1 + W2 - T1 - (W1 - T1 - R) / 2) + ST3 * (W2 - T1 - R) / 2 + ST2 * (W2 - T1 / 2) + SR1 * (W2 * 2 - T1)) / A_ALL;
        // 主惯性矩（型心水平轴）
        double I_ALL = (ST1 * Math.pow(XC - T1 / 2, 2))
            + (ST2 * Math.pow(H / 2 - XC, 2))
            + (T1 * Math.pow(H - 2 * (R + T1), 3) / 12)
            + (ST3 * Math.pow(H - XC - T1 / 2, 2))
            + 2 * SR1 * Math.pow(H / 2 - XC, 2)
            + 2 * SR1 * Math.pow(H / 2 - (R + T1) + XRC, 2);
        // 惯性矩（型心垂直轴）
        double I_ADD = (T1 * Math.pow(W1 - T1 - R, 3) / 12 + ST1 * Math.pow(W1 + W2 - T1 - (W1 - T1 - R) / 2 - YC, 2))
            + ST2 * Math.pow(W2 - T1 / 2 - YC, 2)
            + (T1 * Math.pow(W2 - T1 - R, 3) / 12 + ST3 * Math.pow(W2 - T1 - R - YC, 2))
            + SR1 * Math.pow(W2 - T1 - XRC - YC, 2)
            + SR1 * Math.pow(W2 + XRC - YC, 2);

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
    }

    /**
     * 计算非连续L型角片属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateLProfile(double[][] layerParameters,
                                         double[] shapeParameters,
                                         double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double H = shapeParameters[0];
        double H2 = shapeParameters[1];

        // 竖边面积
        double ST2 = T1 * H2;
        // 总面积
        double A_ALL = ST2;
        // 等效模量
        double E_E = E1;
        double E_G = G1;
        // 型心
        double XC = H2 / 2;
        // 惯性矩
        double I_ALL = T1 * Math.pow(H2, 3) / 12;
        double I_ADD = I_ALL / 8;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
    }

    /**
     * 计算"一"缘条属性
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateFGProfile(double[][] layerParameters,
                                               double[] shapeParameters,
                                               double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double W = shapeParameters[0];

        // 竖边面积
        double ST2 = T1 * W;
        // 总面积
        double A_ALL = ST2;
        // 等效模量
        double E_E = E1;
        double E_G = G1;
        // 型心
        double XC = T1 / 2;
        // 惯性矩
        double I_ALL = W * Math.pow(T1, 3) / 12;
        double I_ADD = T1 * Math.pow(W, 3) / 12;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
    }

    /**
     * 计算SK型缘条属性（与FG型相同）
     *
     * @param layerParameters   边缘参数数组
     * @param shapeParameters   形状参数数组
     * @param sectionProperties 截面属性数组
     */
    public static void calculateSKProfile(double[][] layerParameters,
                                          double[] shapeParameters,
                                          double[] sectionProperties) {
        double T1 = layerParameters[0][0];
        double E1 = layerParameters[0][1];
        double G1 = layerParameters[0][2];
        double W = shapeParameters[0];

        // 竖边面积
        double ST2 = T1 * W;
        // 总面积
        double A_ALL = ST2;
        // 等效模量
        double E_E = E1;
        double E_G = G1;
        // 型心
        double XC = T1 / 2;
        // 惯性矩
        double I_ALL = W * Math.pow(T1, 3) / 12;
        double I_ADD = T1 * Math.pow(W, 3) / 12;

        // 返回值给sectionProperties数组
        sectionProperties[0] = E_E;
        sectionProperties[1] = E_G;
        sectionProperties[2] = XC;
        sectionProperties[3] = A_ALL;
        sectionProperties[4] = I_ALL;
        sectionProperties[5] = I_ADD;
    }

    public static void main(String[] args) {

        // 1. 计算帽型长桁属性 验证
        double[] layerParametersCap = {2.244, 91855.6058367052, 16535.1386807816}; // T, E, G
        double[] shapeParametersCap = {30, 25, 30, 26, 3, 5}; // ALPHA, D, H, L, R1, R2
        double[] sectionPropertiesCap = new double[6]; // E_E, E_G, XC, A_ALL, I_ALL, I_ADD
        calculateCapProfile(layerParametersCap, shapeParametersCap, sectionPropertiesCap);
        // 打印结果
        System.out.println("CAP计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesCap[0]);
        System.out.println("E_G: " + sectionPropertiesCap[1]);
        System.out.println("XC: " + sectionPropertiesCap[2]);
        System.out.println("A_ALL: " + sectionPropertiesCap[3]);
        System.out.println("I_ALL: " + sectionPropertiesCap[4]);
        System.out.println("I_ADD: " + sectionPropertiesCap[5]);


        // 2. T
        double[][] layerParametersT = {{0.005, 200000, 80000, 7850, 12},
            {0.003, 200000, 80000, 7850, 12}};
        double[] shapeParametersT = {0.1, 0.2};
        double[] sectionPropertiesT = new double[8];

        calculateTProfile(layerParametersT, shapeParametersT, sectionPropertiesT);

        // 打印结果
        System.out.println("T计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesT[0]);
        System.out.println("E_G: " + sectionPropertiesT[1]);
        System.out.println("XC: " + sectionPropertiesT[2]);
        System.out.println("A_ALL: " + sectionPropertiesT[3]);
        System.out.println("I_ALL: " + sectionPropertiesT[4]);
        System.out.println("I_ADD: " + sectionPropertiesT[5]);
        System.out.println("E_RHO: " + sectionPropertiesT[6]);
        System.out.println("E_THM: " + sectionPropertiesT[7]);


        // 3. I
        double[][] layerParametersI = {
            {0.005, 200000, 80000, 7850, 12}, // 层1: T1, E1, G1, rho1, THM1
            {0.003, 200000, 80000, 7850, 12}, // 层2: T2, E2, G2, RHO2, THM2
            {0.004, 200000, 80000, 7850, 12}  // 层3: T3, E3, G3, RHO3, THM3
        };

        // 定义形状参数
        double[] shapeParametersI = {0.1, 0.2, 0.1}; // W1, H, W2

        // 初始化截面属性数组
        double[] sectionPropertiesI = new double[8];

        // 调用方法计算截面属性
        calculateIProfile(layerParametersI, shapeParametersI, sectionPropertiesI);

        // 输出截面属性
        System.out.println("I计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesI[0]);
        System.out.println("E_G: " + sectionPropertiesI[1]);
        System.out.println("XC: " + sectionPropertiesI[2]);
        System.out.println("A_ALL: " + sectionPropertiesI[3]);
        System.out.println("I_ALL: " + sectionPropertiesI[4]);
        System.out.println("I_ADD: " + sectionPropertiesI[5]);
        System.out.println("E_RHO: " + sectionPropertiesI[6]);
        System.out.println("E_THM: " + sectionPropertiesI[7]);

        //4. FC
        double[][] layerParametersFc = {{0.005, 200000, 80000, 7850, 12},
            {0.003, 200000, 80000, 7850, 12},
            {0.004, 200000, 80000, 7850, 12}};
        double[] shapeParametersFc = {0.1, 0.2, 0.1, 0.01};
        double[] sectionPropertiesFc = new double[8];

        calculateFcProfile(layerParametersFc, shapeParametersFc, sectionPropertiesFc);

        // 打印结果
        System.out.println("FC计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesFc[0]);
        System.out.println("E_G: " + sectionPropertiesFc[1]);
        System.out.println("XC: " + sectionPropertiesFc[2]);
        System.out.println("A_ALL: " + sectionPropertiesFc[3]);
        System.out.println("I_ALL: " + sectionPropertiesFc[4]);
        System.out.println("I_ADD: " + sectionPropertiesFc[5]);
        System.out.println("E_RHO: " + sectionPropertiesFc[6]);
        System.out.println("E_THM: " + sectionPropertiesFc[7]);

        // 5. FZ
        double[][] layerParametersFZ = {{2.244, 47897.9133790099, 28470.2773615631}};
        double[] shapeParametersFZ = {15, 80, 28, 5};
        double[] sectionPropertiesFZ = new double[6];

        calculateFzProfile(layerParametersFZ, shapeParametersFZ, sectionPropertiesFZ);

        // 打印结果
        System.out.println("FZ计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesFZ[0]);
        System.out.println("E_G: " + sectionPropertiesFZ[1]);
        System.out.println("XC: " + sectionPropertiesFZ[2]);
        System.out.println("A_ALL: " + sectionPropertiesFZ[3]);
        System.out.println("I_ALL: " + sectionPropertiesFZ[4]);
        System.out.println("I_ADD: " + sectionPropertiesFZ[5]);


        // 6. FL
        double[][] layerParametersFL = {{0.005, 200000, 80000}};
        double[] shapeParametersFL = {0.2, 0.1};
        double[] sectionPropertiesFL = new double[6];

        calculateLProfile(layerParametersFL, shapeParametersFL, sectionPropertiesFL);

        // 打印结果
        System.out.println("FL计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesFL[0]);
        System.out.println("E_G: " + sectionPropertiesFL[1]);
        System.out.println("XC: " + sectionPropertiesFL[2]);
        System.out.println("A_ALL: " + sectionPropertiesFL[3]);
        System.out.println("I_ALL: " + sectionPropertiesFL[4]);
        System.out.println("I_ADD: " + sectionPropertiesFL[5]);

        // 7. FG
        double[][] layerParametersFG = {{0.005, 200000, 80000}};
        double[] shapeParametersFG = {0.1};
        double[] sectionPropertiesFG = new double[6];

        calculateFGProfile(layerParametersFG, shapeParametersFG, sectionPropertiesFG);

        // 打印结果
        System.out.println("FG计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesFG[0]);
        System.out.println("E_G: " + sectionPropertiesFG[1]);
        System.out.println("XC: " + sectionPropertiesFG[2]);
        System.out.println("A_ALL: " + sectionPropertiesFG[3]);
        System.out.println("I_ALL: " + sectionPropertiesFG[4]);
        System.out.println("I_ADD: " + sectionPropertiesFG[5]);

        // 8. SK
        double[][] layerParametersSk = {{0.005, 200000, 80000}};
        double[] shapeParametersSk = {80};
        double[] sectionPropertiesSk = new double[6];

        calculateSKProfile(layerParametersSk, shapeParametersSk, sectionPropertiesSk);

        // 打印结果
        System.out.println("SK计算结果打印-------------------------------------------");
        System.out.println("E_E: " + sectionPropertiesSk[0]);
        System.out.println("E_G: " + sectionPropertiesSk[1]);
        System.out.println("XC: " + sectionPropertiesSk[2]);
        System.out.println("A_ALL: " + sectionPropertiesSk[3]);
        System.out.println("I_ALL: " + sectionPropertiesSk[4]);
        System.out.println("I_ADD: " + sectionPropertiesSk[5]);
    }

}
